home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
compuserve-file-archive
/
05 Programming
/
UWEDGE.DOC
< prev
next >
Wrap
Text File
|
2019-04-13
|
16KB
|
289 lines
UTILITY WEDGE (4 APRIL 1985)
Command Summary
* read disk error channel
** send DOS command to disk
*a auto line numbering or renumbering
*b read or write a disk block
*c copy a file or entire disk, change a file type, recover scratched file
*d delete a range of lines
*f show how much free memory
*g get disk directory
*l show load address of program file
*m enable Micromon monitor
*p print seqential file
*q disable (quit) wedge
*t text editor
*u un-new a program
*x dump screen to printer
*! computer cold start (reset)
*# change wedge #
*= change disk drive # (and wedge #)
*+ change border color
*- change background color
*\ change character color
*? show command menu
*/ load program file
*@ load program file to header address
*^ load program file and run it
*_ save program file
*: load seqential file
*; save seqential file
*, load user file
*. save user file
------------------------------------------------------------------------------
The following commands are available when using Micromon (*m)
a assembler b break set
c compare memory d disassembler
e disconnect micromon f fill memory
g go run h hunt memory
j jump to subroutine l load memory from device
m memory display n new locator
o offset or branch calculate p printer toggle (serial bus)
q quick trace r register display
s save memory to device t transfer memory
v verify memory with device w walk through program
x exit to basic (brk enabled) " ascii conversion
# decimal conversion $ hex conversion
% binary conversion & checksum memory
( enable command tone ) disable command tone
+ add hex numbers - subtract hex numbers
> disk directory
Command detail and syntax
I wrote this program with several objectives in mind........ I wanted to be
able to access a lot of utility programs without having to load them in every
time I wanted to use one. Also, I did not want it to slow down the running of
programs, change any of the standard basic commands, nor use up any of the
basic memory space. I also wanted to be able to use abbreviated DOS commands.
The main wedge routines reside in memory from hex $a001 to $cfff. Any program
that does not use memory in this range should be able to co-exist. When
Micromon is in use, the casette buffer is also used. About 2/3 of the memory
used by the wedge is under the basic and Kernal ROMS. Since the wedge is all
machine language, basic is not needed to perform any of the wedge commands,
and is switched out (temporarily) while they are being performed. All wedge
commands must be preceeded by an asterisk (*). The asterisk tells basic
(direct mode only) that the command that follows should be turned over to the
wedge interpreter.
You can load the wedge with the conventional basic statement:
LOAD"WEDGE",8
Next, RUN and the machine code will be transferred to the proper place,
enabled to communicate with disk drive # 8 (default setting), and the command
menu will be displayed. The basic part of the program erases itself after the
wedge is in place.
------------------------------------------------------------------------------
Notes: Unless otherwise noted, any references to numbers can be in decimal or
hex. If you specify hex, the number must be preceeded by the $ symbol.
Example ---- 42 (decimal) or $2a (hex)
Commands which write data to buffers in the 64 will not disturb basic
programs, nor will they overwrite variables or strings. Buffers are allocated
by the wedge from areas that have not yet been used by your basic programs.
The wedge finds these areas by reading the vectors at locations 49 through 52.
@
------------------------------------------------------------------------------
*
This command alone will read the error channel of the disk drive and print it
on the screen.
------------------------------------------------------------------------------
**
Sends any text following the ** to the disk drive as a DOS command. Examples:
**n:diskname,id -> formats a disk
**i -> initializes the drive
**s:filename -> scratches a file
**v -> validates a disk
**r:newname=oldname -> renames a file
------------------------------------------------------------------------------
*a,10 *a,1000,10 *a
This command can take any of those three forms. The first will enable auto
line number feeds. After giving the command, you can start the process by
typing in a basic program line. When you press return, the next line number
will be waiting for you on the following line, and the cursor will be waiting
one space to the right of the number. Auto line number feeds will be discon-
nected automatically when any function is performed other than editing or
entering program lines. This includes listing or running programs, pokes,
peeks, etc. (otherwise it would interfere with these functions). The number
following the comma can be any number from 1 to 63999.
The second form of this command (two numbers) is used to renumber a basic
program residing in the 64. The first number is the number you want the first
line to be, and the second is the step size between line numbers.
The third form of this command disconnects auto line number feeds.
------------------------------------------------------------------------------
*br,$20,$2 *bw,$20,$2
The *br command will read a block of data from the disk, display the location
of the buffer where the data is stored, and enable Micromon so that you can
display the data (see Micromon command docs). Since Micromon displays it's
information in hex, it's usually a good idea to specify hex numbers in the
block-read and block-write wedge commands (to avoid confusion). The first
number is the track, the second is the sector (block).
The *bw command will write a block of data from the buffer to a block on the
disk. This command is usually used after a block-read command, where you have
modified the data and wish to write it back to the block. This command is
very powerful. If you goof using it, you can really mess up a disk, so it's a
good idea to have an extra copy of the disk on hand as insurance. For this
reason, you will also be prompted to confirm your intent to write to the
block (makes you think about it one last time).
------------------------------------------------------------------------------
*c:filename *c:filename,type *c* *c**
The *c:filename command is used to make copies of single files. The file is
read into a buffer from the source disk, and you are prompted for another disk
(must be formatted). Once you have inserted the destination disk, pressing
RETURN will cause the buffered file to be written to it. For large files, it
will be necessary to swap the disks until the entire file is copied (you will
be prompted to do so). Example....*c:wedge will copy the file named "wedge".
No need to specify file type, as that info is read from the directory.
If you use this command on a file that has been scratched, it will recover the
file (not copy it). The file will be recovered as a program file unless you
specify otherwise, as in the following command.
The *c:filename,type command is used to change file types, or to recover
scratched files as a particular file type. For example, *c:wedge,s will
change the file named "wedge" to a seqential file, or will recover a
scratched file named "wedge" as a seqential file. One final note on copying
single files........relative files are not supported. However, you can copy
relative files with the next 2 commands.
The *c* command will make a copy of the entire disk. Disks with a lot of data
on them will need to be swapped a few times (you'll be prompted), and the
destination disk must already be formatted. All blocks allocated in the BAM
will be copied. The *c** command will cause all blocks to be copied, whether
they are allocated in the BAM or not.
*d100-400 *d-300 *d200-
Deletes a specified range of program lines. In the first example, all lines
from 100 to 400 (inclusive) will be deleted. In the second, all from 0 to 300
and in the third, all from 200 up. This command also performs a CLR.
------------------------------------------------------------------------------
*f
Reads out how much unused memory is left for basic in hex and decimal values.
------------------------------------------------------------------------------
*g
Prints the directory of the disk to the screen. This command will not disturb
basic programs like the load"$",8 command does. Pressing the CTRL key will
slow the display, any other key will stop it and return you to command mode.
------------------------------------------------------------------------------
*l:filename
Reads out the load address of a program file in hex and decimal
------------------------------------------------------------------------------
*m
Enables Micromon, a machine language monitor program. Many versions of this
program exist, so I won't go into a detailed list of the commands and their
syntax. There is good documentation available in Compute's First Book of
Commodore 64, though, and the version used in the wedge is very similar. Some
of the differences are that the wedge version resides under the basic rom from
$b000 to $bfff, and is supported by several wedge subroutines; the 'p'
command toggles the printer (device 4) on the serial bus instead of on the
RS232 port; etc. Not different enough to matter much.
------------------------------------------------------------------------------
*p:filename
Prints a sequential file to the screen or to a printer (device 4 on the
serial bus). Pressing the CTRL key while printing to the screen will slow the
display, any other key will pause. While paused, pressing 'x' will terminate
the operation, any other key will resume it.
------------------------------------------------------------------------------
*q
Disables the wedge program. To re-enable it, you must SYS49152.
------------------------------------------------------------------------------
*t
Enables the text editor...see the additional writeup at the end of this DOC.
------------------------------------------------------------------------------
*u
Un-new's a program. This command is useful to those of us who accidentially
type NEW and wish we hadn't. It will recover the program (as long as you
haven't loaded in another one yet). Also performs a CLR.
------------------------------------------------------------------------------
*x
Dumps the screen to the printer. The command line is erased just before the
dump so that you can copy the screen without having *x show up on your
printout. It's good practice to issue this command from a line other than the
last (issuing it from the last line will cause the screen to scroll).
This is a fairly simple screen dump utility. It will not support bitmapped
screens, reverse video will be printed as non-reverse, etc. However, it will
support upper and lower case characters and CBM graphics characters. It does
it by reading the register at $d011 prior to opening the printer file. If the
mode is upper/lower case, a secondary address of 7 is sent to the printer,
else it sends a zero instead. Tested with the CBM 1525, Prowriter 8510 and the
Hewlett-Packard "Thinkjet".
------------------------------------------------------------------------------
*!
Sends the computer to it's cold start routine (same as typing SYS64738)
------------------------------------------------------------------------------
*#9
Switches the wedge number so that you can communicate with a disk drive of a
different address (device 9 in this case). You can specify a device number
from 8 to 31, but you must specify it in decimal (as in the example).
------------------------------------------------------------------------------
*=9
Changes both the wedge number and the number of the disk drive you are
currently communicating with. If you are currently dealing with drive 8,
giving this command will change the drive number to 9 and set the wedge to
communicate with device 9. Same syntax rules apply as in *# command.
------------------------------------------------------------------------------
*+14 *-14 *\5
These commands change the border, background and character color respectively.
*+14 would change the border color to light blue, *-14 changes background to
light blue, and *\5 will make the text green. Numbers must be specified in
decimal. You can give these commands without numbers (*+ *- or *\). In this
case, the color will be incremented to the next higher-numbered one.
------------------------------------------------------------------------------
*?
Displays an abbreviated command menu for quick reference.
------------------------------------------------------------------------------
*/filename *@filename *^filename *_filename
The first example loads a program file the same as load"filename",device. The
second is the same as load"filename",device,1. However, the basic pointers
will not be disturbed. This command is usually used to load machine language
programs, and works the same as the DOS WEDGE command %filename (loads to the
file header address). The third example will load and then run a program
(usually used on basic programs). The fourth is used to save a program, as in
save"filename",device.
In all of these examples (except for *@) you can specify optional addresses
If you specify addresses for the save command, the syntax must follow this
form:
*_filename,addr1,addr2
The first address is the start of the save, the second is one byte MORE than
the last address to be included in the save. Addresses can be hex or decimal.
For the load commands, the syntax is like this:
*/filename,addr *^filename,addr
Specifying a load address will cause the basic pointers to remain untouched,
will override header addresses and cause the load & run (*^) command to
default to load only.
------------------------------------------------------------------------------
*:filename *;filename
These commands will load and save seqential files, respectively. I use it to
put files into RAM somewhere (I usually specify an address to load to) so that
I can examine the data with Micromon. Once in RAM, the data can be modified
and written back, ignored, whatever. Addresses are optional here, too.
------------------------------------------------------------------------------
*,filename *.filename
Load and save user files, repectively. Addresses optional.
------------------------------------------------------------------------------
NOTE: On any of the load/save/copy i/o commands, you can abort reading or
writing with the STOP key. Pressing this key during these i/o operations will
close all files and return you to the basic command level.
------------------------------------------------------------------------------
TEXT EDITOR (*t) see the next doc file